<!DOCTYPE html>
<html lang="zh-cn">
{% load website_info %}
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="renderer" content="webkit">
    <link rel="shortcut icon" href="/static/img/favicon.ico">
    <title>
        {% block title %}
            {% show_website_info "website_name" %}
        {% endblock %}
    </title>

    <!-- global css begin -->
    <link href="/static/css/oj.css" rel="stylesheet">
    <!-- global css end -->

    <!-- custom css begin -->
    {% block css_block %}{% endblock %}
    <!-- custom css end -->
</head>


<body>


<div id="browser-unsupported" style="display: none">人生苦短, 何必还在用这么老的浏览器~
    当前网页 <strong>不支持</strong> 你正在使用的浏览器, 为了正常的访问,
    请 <a href="http://browsehappy.com/">升级你的浏览器</a>。
</div>
<script>
    if(navigator.userAgent.indexOf("MSIE") > -1){
        document.getElementById("browser-unsupported").removeAttribute("style");
    }
</script>

<!-- nav begin -->
<nav class="navbar navbar-masthead navbar-default navbar-static-top">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar"
                    aria-expanded="false" aria-controls="navbar">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="/">{% show_website_info "website_name_shortcut" %}</a>
        </div>
        <div id="navbar" class="navbar-collapse collapse">
            <ul class="nav navbar-nav">
                <li><a href="/problems/">题目</a></li>
                <li><a href="/submissions/">提交</a></li>
                <li><a href="/contests/">比赛</a></li>
                <li><a href="/groups/">小组</a></li>
                <li><a href="/rank/">排名</a></li>
                <li><a href="/help/">帮助</a></li>
            </ul>
            {% if request.user.is_authenticated %}
                <ul class="nav navbar-nav navbar-right">
                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
                           aria-expanded="false">
                            {{ request.user.username }}
                            <span class="caret"></span></a>
                        <ul class="dropdown-menu">
                            {% if request.user.admin_type > 0 %}
                                <li><a href="/admin/">后台管理</a></li>
                                <li role="separator" class="divider"></li>
                            {% endif %}
                            <li><a href="/user/{{ request.user.username }}/">我的主页</a></li>
                            <li><a href="/submissions/?my=true">我的提交</a></li>
                            <li><a href="/account/settings/">设置</a></li>
                            <li role="separator" class="divider"></li>
                            <li><a href="/logout/">退出</a></li>
                        </ul>
                    </li>
                </ul>
            {% else %}
                <ul class="nav navbar-nav navbar-right">
                    <li>
                        <a href="/login/">
                            登录
                        </a>
                    </li>
                </ul>
            {% endif %}
        </div>
    </div>
</nav>
<!-- nav end -->

<!-- custom body begin -->
{% block body %}{% endblock %}
<!-- custom body end -->

<script src="/static/js/config.js"></script>
<script src="/static/js/require.js"></script>
<script src="/static/js/lib/bootstrap/bootstrap.js"></script>
{% block js_block %}{% endblock %}
<!-- footer begin -->
<div class="footer">
    <p class="text-muted text-center">Copyright © 2016 {% autoescape off %}{% show_website_info "website_footer" %}{% endautoescape %}</p>
</div>
<!-- footer end -->
</body>
</html>
